//
//  WBBaseViewController.swift
//  SinaWB
//
//  Created by 财神软件 on 17/2/7.
//  Copyright © 2017年 财神软件. All rights reserved.
//

import UIKit

class WBBaseViewController: UIViewController {
    override var title: String?{
        didSet{
            navitem.title=title
        }
    }
    lazy var navBar :UINavigationBar = UINavigationBar.init(frame: CGRect.init(x: 0, y: 0, width: UIScreen.main.bounds.width, height: 64))
    lazy var navitem: UINavigationItem = UINavigationItem()
    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.addSubview(navBar)
        navBar.items=[navitem]
        navBar.titleTextAttributes=[NSForegroundColorAttributeName:UIColor.darkGray]

        self.view.backgroundColor=UIColor.random()
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    func ToNextVC (VC:UIViewController){
        self.navigationController?.pushViewController(VC, animated: true)
    }
}
